<%@page import="com.xnx3.j2ee.Global"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>  
<%@ taglib uri="http://www.xnx3.com/java_xnx3/xnx3_tld" prefix="x" %>
<jsp:include page="/wm/common/head.jsp">
	<jsp:param name="name" value="订单内商品列表"/>
</jsp:include>
<script src="/<%=Global.CACHE_FILE %>Order_state.js"></script>
<style>
	h2{
		padding-top: 12px;
	    padding-bottom: 5px;
	}
</style>

<div style="margin-top: 10px; text-align: center;">
<h2>订单评价信息</h2>

<table class="layui-table iw_table"  style="color: black;font-size: 14px;" id="orderEvaluationRecord">
	<tr>
		<th style="text-align:center;width:80px;">用户名称</th>
		<th ><div id="orderDate">{username}</div></th>
	</tr>
	<tr>
		<th style="text-align:center;width:90px;">用户手机号</th>
		<th><div id="orderData">{phone}</div></th>
	</tr>
	<tr>
		<th style="text-align:center;width:80px;">服务态度评分</th>
		<th>{serviceAttitude}</th>
	</tr>
	<tr>
		<th style="text-align:center;width:80px;">回收价格评分</th>
		<th>{recyclingPrice}</th>
	</tr>
	<tr>
		<th style="text-align:center;width:80px;">回收时效评分</th>
		<th>{recoveryAging}</th>
	</tr>
	<tr>
		<th style="text-align:center;width:80px;">订单评分</th>
		<th>{orderEvaluationScore}</th>
	</tr>
	<tr>
		<th style="text-align:center;width:80px;">评语</th>
		<th>{orderEvaluation}</th>
	</tr>

</table>
</div>
<script type="text/javascript">
//自适应弹出层大小
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引

//列表的模版
 var orderEvaluationRecordTemplate = document.getElementById("orderEvaluationRecord").innerHTML;
function orderEvaluationRecord(orderEvaluationRecord){
 	if(orderEvaluationRecord.serviceAttitude != null){
		orderEvaluationRecord.serviceAttitude = orderEvaluationRecord.serviceAttitude/10;
		orderEvaluationRecord.serviceAttitude = orderEvaluationRecord.serviceAttitude.toFixed(1);
	}
 	if(orderEvaluationRecord.recyclingPrice != null){
 		orderEvaluationRecord.recyclingPrice = orderEvaluationRecord.recyclingPrice/10;
 		orderEvaluationRecord.recyclingPrice = orderEvaluationRecord.recyclingPrice.toFixed(1);
	}
 	if(orderEvaluationRecord.recoveryAging != null){
 		orderEvaluationRecord.recoveryAging = orderEvaluationRecord.recoveryAging/10;
 		orderEvaluationRecord.recoveryAging = orderEvaluationRecord.recoveryAging.toFixed(1);
	}
 	if(orderEvaluationRecord.orderEvaluationScore != null){
 		orderEvaluationRecord.orderEvaluationScore = orderEvaluationRecord.orderEvaluationScore/10;
 		orderEvaluationRecord.orderEvaluationScore = orderEvaluationRecord.orderEvaluationScore.toFixed(1);
	}
		return orderEvaluationRecordTemplate.replace(/\{orderEvaluationScore\}/g, orderEvaluationRecord.orderEvaluationScore == null? '5.0':orderEvaluationRecord.orderEvaluationScore)
		.replace(/\{orderEvaluation\}/g, orderEvaluationRecord.orderEvaluation == null? '此用户没有写评语':orderEvaluationRecord.orderEvaluation)
		.replace(/\{serviceAttitude\}/g, orderEvaluationRecord.serviceAttitude == null? '5.0':orderEvaluationRecord.serviceAttitude)
		.replace(/\{recyclingPrice\}/g, orderEvaluationRecord.recyclingPrice == null? '5.0':orderEvaluationRecord.recyclingPrice)
		.replace(/\{recoveryAging\}/g, orderEvaluationRecord.recoveryAging == null? '5.0':orderEvaluationRecord.recoveryAging)
		;
}
//列表的模版
var orderTemplate = document.getElementById("orderDate").innerHTML;
function orderDate(order){
		return orderTemplate.replace(/\{username\}/g, order.username)
		;
}
//列表的模版
var orderDataTemplate = document.getElementById("orderData").innerHTML;
function orderData(order){
		return orderDataTemplate.replace(/\{phone\}/g, order.phone)
		;
}
msg.loading('加载中');
var id = getUrlParams('id');
post('/superadmin/order/orderDetails.json?id='+ id,{},function(data){
	msg.close();    //关闭“更改中”的等待提示
	checkLogin(data);	//验证登录状态。如果未登录，那么跳转到登录页面
	if(data.result == '1'){
		document.getElementById("orderEvaluationRecord").innerHTML = orderEvaluationRecord(data.orderEvaluationRecord);
		document.getElementById("orderDate").innerHTML = orderDate(data.order);
		document.getElementById("orderData").innerHTML = orderData(data.order);
	}
});
</script>
<jsp:include page="/wm/common/foot.jsp"></jsp:include>